
<div id="page-wrapper">
	<h1><?php if($title){ echo $title; } ?></h1><br>
<?php if($logged_in['su'] =="1"){ ?>
<a href="<?php echo site_url('user_data');?>">Back</a>
<?php } ?>
<?php 
//var_dump($user);
if($resultstatus){ echo "<div id='result' style='text-align:center ;> <font color='#fff' size='4'>".$resultstatus."</font></div>"; }
 ?>
<form method="post" action="<?php echo site_url('user_data/update_user/'.$user_id);?>">
	<div class="form-group">
                <label>Username</label>
                <input class="form-control" required="required" type="text" name="username" value="<?php echo $user['username']; ?>"  >
    </div>
    <div class="form-group">
                <label>First Name</label>
                <input class="form-control" required="required" type="text" name="first_name" value="<?php echo $user['first_name']; ?>">
    </div>
    <div class="form-group">
                <label>Email</label>
                <input class="form-control" required="required" type="email" name="user_email" value="<?php echo $user['email']; ?>"  <?php	if($su=="0"){ echo "readonly='readonly'"; }?> >
    </div>
    <div class="form-group">
                <label>Password (optional)</label>
                <input class="form-control" required="required" type="password" name="user_password" autocomplete="off" >
    </div>
     <div class="form-group">
                <label>Confirm Password</label>
                <input class="form-control" required="required" type="password" name="confirm_password" autocomplete="off">
    </div>
    <div class="form-group">
                <label>Credit</label>
               <input class="form-control" required="required" type="text" name="user_credit" value="<?php echo $user['credit']; ?>"  <?php	if($su=="0"){ echo "readonly='readonly'"; }?> >
    </div>
    <div class="form-group">
                <select class="form-control" name="user_group">
					<?php foreach($allgroups as $key => $group){ ?>
						<?php if($su=="1"){ ?>						
						<option <?php if($user['gid'] == $group['gid']){ echo "selected"; } ?> value="<?php echo $group['gid']; ?>"><?php echo $group['group_name']; ?></option>
						<?php }else{ 
						if($user['gid'] == $group['gid']){
						?>
						<option value="<?php echo $group['gid']; ?>"><?php echo $group['group_name']; ?></option>
						<?php 
							}
						 } 
						 ?>
						
					<?php } ?>
				</select>
    </div>
    <button type="submit" class="btn btn-default">Submit Button</button>
</form>
</div>












